﻿using System;
using RAP.Framework.Libary.DomTemplateBuilder.Attributes;
using RAP.Framework.Libary.DomTemplateBuilder.Handler.Cache;

namespace RAP.Framework.Libary.DomTemplateBuilder.Element.Cache
{
	/// <summary>
	/// Cache的值节点
	/// </summary>
	[TagHandler( "Cache.CacheValue", typeof( CacheValueHandler ) )]
	public class CacheValue : ElementBase
    {
		public override void Initialize ( System.Xml.XmlNode node )
		{
			SetCache parentEle = this.Parent as SetCache;
			if ( parentEle.CacheValue != null )
			{
				throw new Exception ( "任何条件节点只能包含一个CacheValue节点！" );
			}
			parentEle.CacheValue = this;
		}
        
    }
}
